{{!
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements.  See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership.  The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License.  You may obtain a copy of the License at
*
*     http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
}}

{{#if modalGuard}}
  <div class="modal fade" tabindex=-1 role="dialog">
    <div class="modal-dialog">
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="fa fa-times pull-right" {{action 'close'}}></button>
          <h4 class="modal-title">{{fa-icon icon="trash"}} Delete</h4>
        </div>
        <div class="modal-body">
          {{#unless isDeleting}}
            {{#unless hasError}}
              <p class="lead">Are you sure you want to delete{{#if hasFiles}} {{filesCount}} file(s){{#if hasFolders}} and {{/if}}{{/if}}{{#if hasFolders}} {{folderCount}} folder(s) {{/if}}?</p>
              {{#if showDeletePermanentCheckbox}}
                <div class="checkbox">
                  <label>
                    {{input type="checkbox" checked=deletePermanently}} <strong>Delete permanently</strong>
                  </label>
                </div>
              {{/if}}
            {{else}}
              <p class="text-danger">{{{currentFailureMessage}}}</p>
              {{alert-message-display title="Details:"
                value=currentServerFailureMessage
                shorten=true
                length=100}}
            {{/unless}}
          {{else}}
            <div class="text-center">
              {{fa-icon "spinner" spin=true size="2"}}
            </div>
          {{/unless}}
        </div>
        <div class="modal-footer">
          {{#unless hasError}}
            <button type="button" class="btn btn-default" disabled={{isDeleting}} {{action "close"}}>{{fa-icon "remove"}} Cancel</button>
            <button type="button" class="btn btn-danger" disabled={{isDeleting}} {{action "delete"}}>{{fa-icon "trash"}} Delete</button>
          {{else}}
            {{#unless shouldRetry}}
              <button type="button" class="btn btn-default" disabled={{isDeleting}} {{action "close"}}>{{fa-icon "remove"}} Cancel</button>
            {{/unless}}
            <button type="button" class="btn btn-danger" disabled={{isDeleting}} {{action "retryError"}}>{{fa-icon "refresh"}} Retry</button>
            {{#if shouldRetry}}
              <button type="button" class="btn btn-danger" disabled={{isDeleting}} {{action "skipAndRetry"}}>{{fa-icon "step-forward"}} Skip</button>
              <button type="button" class="btn btn-danger" disabled={{isDeleting}} {{action "skipAll"}}>{{fa-icon "fast-forward"}} Skip All</button>
            {{/if}}
          {{/unless}}
        </div>
      </div>
    </div>
  </div>
{{/if}}
